home *** CD-ROM | disk | FTP | other *** search
/ Aminet 43 / Aminet 43 (2001)(GTI - Schatztruhe)[!][Jun 2001].iso / Aminet / hard / drivr / opencnet.lha / opencnet.c < prev    next >
C/C++ Source or Header  |  2001-04-11  |  595b  |  28 lines

  1. #include <exec/types.h>
  2.  
  3. #include <devices/sana2.h>
  4. #include <dos/dos.h>
  5.  
  6. #include <clib/alib_protos.h>
  7. #include <clib/exec_protos.h>
  8.  
  9. VOID main(VOID)
  10. {
  11. struct IOSana2Req    *cnetReqBlk;
  12. struct MsgPort        *cnetPort;
  13.  
  14.     if(cnetPort=CreatePort(NULL, NULL))
  15.     {
  16.         if(cnetReqBlk=(struct IOSana2Req *)CreateExtIO(cnetPort, sizeof(struct IOSana2Req)))
  17.         {
  18.             if(!OpenDevice("Networks/cnet.device", 0, (struct IORequest *)cnetReqBlk, NULL))
  19.             {
  20.                 Wait(SIGBREAKF_CTRL_C);
  21.                 CloseDevice((struct IORequest *)cnetReqBlk);
  22.             }
  23.             DeleteExtIO((struct IORequest *)cnetReqBlk);
  24.         }
  25.         DeletePort(cnetPort);
  26.     }
  27. }
  28.